<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="generator" content="ApiGen 2.8.0" />

	<title>Class CI_Migration | tis</title>

	<script type="text/javascript" src="resources/combined.js?1735077957"></script>
	<script type="text/javascript" src="elementlist.js?2977522689"></script>
	<link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360" />

</head>

<body>
<div id="left">
	<div id="menu">
		<a href="index.html" title="Overview"><span>Overview</span></a>


		<div id="groups">
			<h3>Packages</h3>
			<ul>
				<li class="active"><a href="package-CodeIgniter.html">CodeIgniter<span></span></a>
						<ul>
				<li><a href="package-CodeIgniter.Controllers.html">Controllers</a>
						</li>
				<li><a href="package-CodeIgniter.Drivers.html">Drivers</a>
						</li>
				<li class="active"><a href="package-CodeIgniter.Libraries.html">Libraries</a>
						</li>
				<li><a href="package-CodeIgniter.Models.html">Models</a>
						</li>
							</ul></li>
				<li><a href="package-None.html">None</a>
						</li>
			</ul>
		</div>

		<hr />


		<div id="elements">
			<h3>Classes</h3>
			<ul>
				<li><a href="class-Authhelper.html">Authhelper</a></li>
				<li><a href="class-CI_Benchmark.html">CI_Benchmark</a></li>
				<li><a href="class-CI_Cache.html">CI_Cache</a></li>
				<li><a href="class-CI_Cache_apc.html">CI_Cache_apc</a></li>
				<li><a href="class-CI_Cache_dummy.html">CI_Cache_dummy</a></li>
				<li><a href="class-CI_Cache_file.html">CI_Cache_file</a></li>
				<li><a href="class-CI_Cache_memcached.html">CI_Cache_memcached</a></li>
				<li><a href="class-CI_Calendar.html">CI_Calendar</a></li>
				<li><a href="class-CI_Cart.html">CI_Cart</a></li>
				<li><a href="class-CI_Config.html">CI_Config</a></li>
				<li><a href="class-CI_Controller.html">CI_Controller</a></li>
				<li><a href="class-CI_Driver.html">CI_Driver</a></li>
				<li><a href="class-CI_Driver_Library.html">CI_Driver_Library</a></li>
				<li><a href="class-CI_Email.html">CI_Email</a></li>
				<li><a href="class-CI_Encrypt.html">CI_Encrypt</a></li>
				<li><a href="class-CI_Exceptions.html">CI_Exceptions</a></li>
				<li><a href="class-CI_Form_validation.html">CI_Form_validation</a></li>
				<li><a href="class-CI_FTP.html">CI_FTP</a></li>
				<li><a href="class-CI_Hooks.html">CI_Hooks</a></li>
				<li><a href="class-CI_Image_lib.html">CI_Image_lib</a></li>
				<li><a href="class-CI_Input.html">CI_Input</a></li>
				<li><a href="class-CI_Javascript.html">CI_Javascript</a></li>
				<li><a href="class-CI_Jquery.html">CI_Jquery</a></li>
				<li><a href="class-CI_Lang.html">CI_Lang</a></li>
				<li><a href="class-CI_Loader.html">CI_Loader</a></li>
				<li><a href="class-CI_Log.html">CI_Log</a></li>
				<li class="active"><a href="class-CI_Migration.html">CI_Migration</a></li>
				<li><a href="class-CI_Model.html">CI_Model</a></li>
				<li><a href="class-CI_Output.html">CI_Output</a></li>
				<li><a href="class-CI_Pagination.html">CI_Pagination</a></li>
				<li><a href="class-CI_Parser.html">CI_Parser</a></li>
				<li><a href="class-CI_Profiler.html">CI_Profiler</a></li>
				<li><a href="class-CI_Router.html">CI_Router</a></li>
				<li><a href="class-CI_Security.html">CI_Security</a></li>
				<li><a href="class-CI_Session.html">CI_Session</a></li>
				<li><a href="class-CI_SHA1.html">CI_SHA1</a></li>
				<li><a href="class-CI_Table.html">CI_Table</a></li>
				<li><a href="class-CI_Trackback.html">CI_Trackback</a></li>
				<li><a href="class-CI_Unit_test.html">CI_Unit_test</a></li>
				<li><a href="class-CI_Upload.html">CI_Upload</a></li>
				<li><a href="class-CI_URI.html">CI_URI</a></li>
				<li><a href="class-CI_User_agent.html">CI_User_agent</a></li>
				<li><a href="class-CI_Utf8.html">CI_Utf8</a></li>
				<li><a href="class-CI_Xmlrpc.html">CI_Xmlrpc</a></li>
				<li><a href="class-CI_Xmlrpcs.html">CI_Xmlrpcs</a></li>
				<li><a href="class-CI_Zip.html">CI_Zip</a></li>
				<li><a href="class-MY_Controller.html">MY_Controller</a></li>
				<li><a href="class-Welcome.html">Welcome</a></li>
			</ul>





		</div>
	</div>
</div>

<div id="splitter"></div>

<div id="right">
<div id="rightInner">
	<form id="search">
		<input type="hidden" name="cx" value="" />
		<input type="hidden" name="ie" value="UTF-8" />
		<input type="text" name="q" class="text" />
		<input type="submit" value="Search" />
	</form>

	<div id="navigation">
		<ul>
			<li>
				<a href="index.html" title="Overview"><span>Overview</span></a>
			</li>
			<li>
				<a href="package-CodeIgniter.Libraries.html" title="Summary of CodeIgniter\Libraries"><span>Package</span></a>
			</li>
			<li class="active">
<span>Class</span>			</li>
		</ul>
		<ul>
			<li>
				<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
			</li>
		</ul>
		<ul>
		</ul>
	</div>

<div id="content" class="class">
	<h1>Class CI_Migration</h1>


	<div class="description">
	
<p>Migration Class</p>

<p>All migrations should implement this, forces up() and down() and gives access
to the CI super-global.</p>

	</div>









	<div class="info">
		
		
		
		<b>Package:</b> <a href="package-CodeIgniter.html">CodeIgniter</a>\<a href="package-CodeIgniter.Libraries.html">Libraries</a><br />

				<b>Category:</b>
				Libraries<br />
				<b>Author:</b>
				Reactor Engineers<br />
				<b>Link</b>
				<br />
		<b>Located at</b> <a href="source-class-CI_Migration.html#18-325" title="Go to source code">system/libraries/Migration.php</a><br />
	</div>



	<table class="summary" id="methods">
	<caption>Methods summary</caption>
	<tr data-order="__construct" id="___construct">

		<td class="attributes"><code>
			 public 
			
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#___construct">#</a>
		<code><a href="source-class-CI_Migration.html#38-82" title="Go to source code">__construct</a>( <span>mixed <var>$config</var> = <span class="php-keyword1">array</span>()</span> )</code>

		<div class="description short">
			
		</div>

		<div class="description detailed hidden">
			







		</div>
		</div></td>
	</tr>
	<tr data-order="version" id="_version">

		<td class="attributes"><code>
			 public 
			mixed
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_version">#</a>
		<code><a href="source-class-CI_Migration.html#86-210" title="Go to source code">version</a>( <span>integer <var>$target_version</var></span> )</code>

		<div class="description short">
			
<p>Migrate to a schema version</p>

		</div>

		<div class="description detailed hidden">
			
<p>Migrate to a schema version</p>

<p>Calls each migration step required to get to the schema version of choice</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$target_version</var></dt>
					<dd><code>integer</code><br>Target schema version</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code>mixed</code><br>TRUE if already latest, FALSE if failed, int if upgraded<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="latest" id="_latest">

		<td class="attributes"><code>
			 public 
			mixed
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_latest">#</a>
		<code><a href="source-class-CI_Migration.html#214-232" title="Go to source code">latest</a>( )</code>

		<div class="description short">
			
<p>Set's the schema to the latest migration</p>

		</div>

		<div class="description detailed hidden">
			
<p>Set's the schema to the latest migration</p>




				<h4>Returns</h4>
				<div class="list">
					<code>mixed</code><br>true if already latest, false if failed, int if upgraded<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="current" id="_current">

		<td class="attributes"><code>
			 public 
			mixed
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_current">#</a>
		<code><a href="source-class-CI_Migration.html#236-244" title="Go to source code">current</a>( )</code>

		<div class="description short">
			
<p>Set's the schema to the migration version set in config</p>

		</div>

		<div class="description detailed hidden">
			
<p>Set's the schema to the migration version set in config</p>




				<h4>Returns</h4>
				<div class="list">
					<code>mixed</code><br>true if already current, false if failed, int if upgraded<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="error_string" id="_error_string">

		<td class="attributes"><code>
			 public 
			string
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_error_string">#</a>
		<code><a href="source-class-CI_Migration.html#248-256" title="Go to source code">error_string</a>( )</code>

		<div class="description short">
			
<p>Error string</p>

		</div>

		<div class="description detailed hidden">
			
<p>Error string</p>




				<h4>Returns</h4>
				<div class="list">
					<code>string</code><br>Error message returned as a string<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="find_migrations" id="_find_migrations">

		<td class="attributes"><code>
			 protected 
			mixed
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#_find_migrations">#</a>
		<code><a href="source-class-CI_Migration.html#260-283" title="Go to source code">find_migrations</a>( )</code>

		<div class="description short">
			
<p>Set's the schema to the latest migration</p>

		</div>

		<div class="description detailed hidden">
			
<p>Set's the schema to the latest migration</p>




				<h4>Returns</h4>
				<div class="list">
					<code>mixed</code><br>true if already latest, false if failed, int if upgraded<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="_get_version" id="__get_version">

		<td class="attributes"><code>
			 protected 
			integer
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#__get_version">#</a>
		<code><a href="source-class-CI_Migration.html#287-296" title="Go to source code">_get_version</a>( )</code>

		<div class="description short">
			
<p>Retrieves current schema version</p>

		</div>

		<div class="description detailed hidden">
			
<p>Retrieves current schema version</p>




				<h4>Returns</h4>
				<div class="list">
					<code>integer</code><br>Current Migration<br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="_update_version" id="__update_version">

		<td class="attributes"><code>
			 protected 
			boolean
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#__update_version">#</a>
		<code><a href="source-class-CI_Migration.html#300-311" title="Go to source code">_update_version</a>( <span>integer <var>$migrations</var></span> )</code>

		<div class="description short">
			
<p>Stores the current schema version</p>

		</div>

		<div class="description detailed hidden">
			
<p>Stores the current schema version</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$migrations</var></dt>
					<dd><code>integer</code><br>Migration reached</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code>boolean</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	<tr data-order="__get" id="___get">

		<td class="attributes"><code>
			 public 
			mixed
			
			</code>
		</td>

		<td class="name"><div>
		<a class="anchor" href="#___get">#</a>
		<code><a href="source-class-CI_Migration.html#315-324" title="Go to source code">__get</a>( <span>mixed <var>$var</var></span> )</code>

		<div class="description short">
			
<p>Enable the use of CI super-global</p>

		</div>

		<div class="description detailed hidden">
			
<p>Enable the use of CI super-global</p>



				<h4>Parameters</h4>
				<div class="list"><dl>
					<dt><var>$var</var></dt>
					<dd><code>mixed</code><br>$var</dd>
				</dl></div>

				<h4>Returns</h4>
				<div class="list">
					<code>mixed</code><br />
				</div>




		</div>
		</div></td>
	</tr>
	</table>












	<table class="summary" id="properties">
	<caption>Properties summary</caption>
	<tr data-order="_migration_enabled" id="$_migration_enabled">
		<td class="attributes"><code>
			protected  
			boolean
		</code></td>

		<td class="name">
				<a href="source-class-CI_Migration.html#32" title="Go to source code"><var>$_migration_enabled</var></a>
		</td>
		<td class="value"><code><span class="php-keyword1">FALSE</span></code></td>
		<td class="description"><div>
			<a href="#$_migration_enabled" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	<tr data-order="_migration_path" id="$_migration_path">
		<td class="attributes"><code>
			protected  
			mixed
		</code></td>

		<td class="name">
				<a href="source-class-CI_Migration.html#33" title="Go to source code"><var>$_migration_path</var></a>
		</td>
		<td class="value"><code><span class="php-keyword1">NULL</span></code></td>
		<td class="description"><div>
			<a href="#$_migration_path" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	<tr data-order="_migration_version" id="$_migration_version">
		<td class="attributes"><code>
			protected  
			integer
		</code></td>

		<td class="name">
				<a href="source-class-CI_Migration.html#34" title="Go to source code"><var>$_migration_version</var></a>
		</td>
		<td class="value"><code><span class="php-num">0</span></code></td>
		<td class="description"><div>
			<a href="#$_migration_version" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	<tr data-order="_error_string" id="$_error_string">
		<td class="attributes"><code>
			protected  
			string
		</code></td>

		<td class="name">
				<a href="source-class-CI_Migration.html#36" title="Go to source code"><var>$_error_string</var></a>
		</td>
		<td class="value"><code><span class="php-quote">''</span></code></td>
		<td class="description"><div>
			<a href="#$_error_string" class="anchor">#</a>

			<div class="description short">
				
			</div>

			<div class="description detailed hidden">
				

			</div>
		</div></td>
	</tr>
	</table>






</div>

	<div id="footer">
		tis API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a>
	</div>
</div>
</div>
</body>
</html>
